<template>
	<view class="ucenter-page">
		<u-navbar title-size="36"  height="42" :border-bottom="false" title="我的消息"></u-navbar>
		<view class="wrap">
			<view class="u-tabs-box">
				<u-tabs-swiper activeColor="#606366" inactive-color="#606366" ref="tabs" :list="list" :current="current"
					@change="change" :is-scroll="false" swiperWidth="750" height="90" bar-width="120"
					:bar-style="barStyle" :active-item-style="activeStyle"></u-tabs-swiper>
			</view>
			<swiper class="swiper-box" :current="swiperCurrent" @transition="transition"
				@animationfinish="animationfinish">
				<swiper-item class="swiper-item">
					<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom">
						<view class="scroll-content">
							<view class="msg-cell">
								<view class="title">您有一条线索变更消息</view>
								<view class="time">2021-09-08 12:56</view>
								<view class="infos">
									<view class="item">线索号：XS20210908</view>
									<view class="item">客户姓名：张**</view>
								</view>
								<view class="clue-panel">
									<view class="head">
										<view class="title">跟进状态</view>
										<view class="arrow">
											<button type="default" class="btn appeal-btn">申诉</button>
										</view>
									</view>
									<view class="clue-body">
										<u-time-line>
											<u-time-line-item>
												<!-- 此处自定义了左边内容，用一个图标替代 -->
												<template v-slot:node>
													<view class="u-node"></view>
												</template>
												<template v-slot:content>
													<view>
														<view class="u-order-head">
															<view class="u-order-state">已关闭</view>
															<view class="u-order-time">2021-05-19 18:03</view>
														</view>
														<view class="u-order-desc">
															尊敬的xxx，很遗憾，您推荐的客户已经采购其他品牌，感谢您对中联重科的支持，小云为您准备了商机核实佣金奖励，快来领取吧。</view>
													</view>
												</template>
											</u-time-line-item>
											<u-time-line-item>
												<!-- 此处没有自定义左边的内容，会默认显示一个点 -->
												<template v-slot:node>
													<view class="u-node" style="background: #9DC851;"></view>
												</template>
												<template v-slot:content>
													<view>
														<view class="u-order-head">
															<view class="u-order-state green">跟进中</view>
															<view class="u-order-time">2021-05-14 13:12</view>
														</view>
														<view class="u-order-desc">尊敬的xxx，营销代表xxx正在持续跟进线索，佣金离您越来越近了，您可以先<text class="green">完善个人资料</text>，提前做好接佣准备。</view>
													</view>
												</template>
											</u-time-line-item>
											<u-time-line-item>
												<!-- 此处没有自定义左边的内容，会默认显示一个点 -->
												<template v-slot:node>
													<view class="u-node" style="background: #9DC851;"></view>
												</template>
												<template v-slot:content>
													<view>
														<view class="u-order-head">
															<view class="u-order-state green">跟进中 (有成单设备出现）</view>
															<view class="u-order-time">2021-05-14 13:12</view>
														</view>
														<view class="u-order-desc">尊敬的XXX，恭喜您，您推荐的线索中有一台XXX机型已经成单了，小云为您准备了丰厚的商机成交佣金，快来领取吧。</view>
													</view>
												</template>
											</u-time-line-item>
											<u-time-line-item>
												<!-- 此处没有自定义左边的内容，会默认显示一个点 -->
												<template v-slot:node>
													<view class="u-node"></view>
												</template>
												<template v-slot:content>
													<view>
														<view class="u-order-head">
															<view class="u-order-state">已分派</view>
															<view class="u-order-time">2021-05-14 13:12</view>
														</view>
														<view class="u-order-desc">尊敬的xxx，区域经理xxx正指派就近的业务人员跟进，请继续关注下一步进展。</view>
													</view>
												</template>
											</u-time-line-item>
											<u-time-line-item>
												<!-- 此处没有自定义左边的内容，会默认显示一个点 -->
												<template v-slot:node>
													<view class="u-node"></view>
												</template>
												<template v-slot:content>
													<view>
														<view class="u-order-head">
															<view class="u-order-state">已接单</view>
															<view class="u-order-time">2021-05-14 13:12</view>
														</view>
														<view class="u-order-desc">尊敬的xxx，我们正在核实您提供的线索，请保持关注，小云将实时向您推送最新的跟进情况。</view>
													</view>
												</template>
											</u-time-line-item>
										</u-time-line>
									</view>
								</view>
							</view>
						</view>
					</scroll-view>
				</swiper-item>
				<swiper-item class="swiper-item">
					<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom">
						<view class="scroll-content">
							<view class="msg-cell">
								<view class="title">您有一条咨询消息</view>
								<view class="time">2021-09-08 12:56</view>
								<view class="infos">
									<view class="question">您的咨询：我是详细内容我是详细内容</view>
									<view class="reply">客服回复：我是详细内容我是详细内容我是详细内容我是详细内容我是详细内容我是详细内容</view>
								</view>
							</view>
						</view>
					</scroll-view>
				</swiper-item>
				<swiper-item class="swiper-item">
					<scroll-view scroll-y style="height: 100%;width: 100%;">

					</scroll-view>
				</swiper-item>
			</swiper>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				list: [{
						name: '线索消息'
					},
					{
						name: '咨询消息'
					},
					{
						name: '系统消息'
					}
				],
				current: 0,
				swiperCurrent: 0,
				tabsHeight: 0,
				dx: 0,
				barStyle: {
					backgroundColor: "#A2C833",
					bottom: '0rpx'
				},
				activeStyle: {
					fontWeight: 'normal'
				}
			};
		},
		onLoad() {

		},
		methods: {
			// tab栏切换
			change(index) {
				this.swiperCurrent = index;
			},
			transition({
				detail: {
					dx
				}
			}) {
				this.$refs.tabs.setDx(dx);
			},
			animationfinish({
				detail: {
					current
				}
			}) {
				this.$refs.tabs.setFinishCurrent(current);
				this.swiperCurrent = current;
				this.current = current;
			},
			openUrl(e) {
				console.log(e)
				uni.navigateTo({
					url: e
				});
			},
		}
	};
</script>
<style lang="scss">
	page {
		background-color: #F5F5F5;
	}

	.scroll-content {
		padding: 32rpx;
	}

	.msg-cell {
		
		.title {
			font-size: 32rpx;
			color: #303337;
			font-weight: 600;
			line-height: 44rpx;
			margin-bottom: 8rpx;
		}

		.infos {
			font-size: 26rpx;
			color: #606366;
			line-height: 42rpx;
			margin-bottom: 48rpx;
		}

		.time {
			font-size: 24rpx;
			color: #9C9C9C;
			margin-bottom: 24rpx;
		}

	}

	.wrap {
		display: flex;
		flex-direction: column;
		height: calc(100vh - 62px);
		width: 100%;
	}

	.swiper-box {
		flex: 1;
	}

	.swiper-item {
		height: 100%;
	}

	// swiper{
	// 	height: calc(1005 - 45px);
	// }
	
	.clue-panel {
		background-color: #fff;
		margin-bottom: 24rpx;
		border-radius: 12rpx;
	
		.head {
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 24rpx 32rpx;
	
			.title {
				font-size: 32rpx;
				color: #303337;
				font-weight: 600;
				line-height: 44rpx;
			}
	
			.arrow {
				.appeal-btn {
					font-size: 24rpx;
					color: #FFFFFF;
					background-color: #A5A098;
					line-height: 48rpx;
					border-radius: 24rpx;
					width: 92rpx;
					padding: 0;
				}
			}
		}
	
		.clue-body {
			padding: 0 32rpx 32rpx;
		}
	}
	
	.green {
		color: #9DC851 !important;
	}
	
	.u-node {
		width: 18rpx;
		height: 18rpx;
		border-radius: 50%;
		display: flex;
		justify-content: center;
		align-items: center;
		background: #303337;
	}
	
	.u-order-head {
		display: flex;
		align-items: flex-end;
		margin-bottom: 8rpx;
	}
	
	.u-order-desc {
		color: #606366;
		font-size: 26rpx;
		line-height: 40rpx;
	}
	
	.u-order-time {
		color: #9C9C9C;
		font-size: 24rpx;
	}
	
	.u-order-state {
		color: #606366;
		font-size: 28rpx;
		margin-right: 24rpx;
	}
</style>
